package com.codingfuture.mapper;

import com.codingfuture.entity.Question;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface QuestionMapper {
    List<Question> findAll();

//    @Insert("insert into question(title,type,content_id) " +
//            "values(#{title},#{type},#{contentId})")
//    @Select("select * from question")
//    List<Question> findAll();

    @Insert("insert into question(title,type,content_id) " +
            "values(#{title},#{type},#{contentId})")
    int insert(Question question);

    @Delete("delete from question where qid=#{id}")
    int deleteById(Integer id);

//   @Update("update question set qname=#{qname} where qid=#{id}")
////    int update(Question question);
//    int updateQuestion(Question question);

    int updateById(Question question);

    @Select("select * from question where qid = #{qid}")
    Question findById(Integer id);
}
